package com.formulas.certification.config;

import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Contact;
import io.swagger.v3.oas.models.info.Info;
import org.springdoc.core.models.GroupedOpenApi;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@EnableKnife4j
public class OpenAPIConfig {

    @Bean
    public GroupedOpenApi certificationApi() {
        return GroupedOpenApi.builder()
                .group("formulas-certification")
                .packagesToScan("com.formulas.certification.web")
                .build();
    }

    @Bean
    public OpenAPI openAPI() {
        return new OpenAPI().info(new Info()
                .title("formulas-certification接口文档")
                        .contact(new Contact()
                                .url("https://gitee.com/chengqiangxj")
                                .email("yiwannuofulasi@163.com")
                                .name("坚持是一种技术")
                        )
                .description("奋斗，即使肩有重担，一条腿也要大步向前！")
                .version("1.0.1"));
    }

}
